package com.third.device.mg.serialport.factory.lemanli

import kotlin.experimental.xor

/**
 * @Date 2022/1/20
 * Description:乐满利指令校验码
 * D6 = D1.xor(D2).xor(D3).xor(D4).xor(D5)
 */
object LeManLiCRC {

    fun crcXor(msg:ByteArray):Byte{
        var result :Byte = 0
        for (index in 1 until msg.size){
            result = result.xor(msg[index])
        }
        return result
    }
}